package thread;
public class ThreadDemo8 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()-> {
            // 这个线程的运行时间大概是1s
            try {
                Thread.sleep(1000);
            }catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        System.out.println("start 之前: " + t.isAlive());
        t.start();
        System.out.println("start 之后: " + t.isAlive());
        Thread.sleep(2000);
        // 2s 之后, 线程 t 已经结束了
        System.out.println("t 结束后: " + t.isAlive());
    }
}
